import 'reflect-metadata';

@Reflect.metadata('decri', '都是地球人')
class People {
  @Reflect.metadata('descible', '姓名不能包含非法汉字')
  username = 'wangewu';
  @Reflect.metadata('food', '去吃肯德基啊')
  @Reflect.metadata('drink', '喝可乐呀')
  eat() {}
}

// 获取类上的元数据
console.log(Reflect.getMetadataKeys(People.prototype, 'eat'));
Reflect.getMetadataKeys(People.prototype, 'eat').forEach((metaKey) => {
  console.log(
    '==metaKey=== ',
    metaKey,
    '==value==',
    Reflect.getMetadata(metaKey, People.prototype, 'eat')
  );
});
